
"""
如何高效对有序数组/链表去重？
"""
def quickPoint(arr):
    slow = 0
    fast = 1
    while fast < len(arr):
        if arr[fast] != arr[slow]:
            slow+=1
            arr[slow] = arr[fast]
        fast+=1
    return slow


nums = [1,1,2,2]
assert quickPoint(nums),2
print(nums)